<%@ taglib uri="/WEB-INF/tags/c.tld" prefix="c" %>	
<%@ taglib uri="/WEB-INF/tags/fn.tld" prefix="fn" %>	
<%@ taglib uri="/WEB-INF/tags/fmt.tld" prefix="fmt" %>	
<%@ taglib uri="/WEB-INF/tags/spring.tld" prefix="spring" %>	
<%@ taglib uri="/WEB-INF/tags/spring-form.tld" prefix="form" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>

<div>
	<h1><spring:message code="my.kurancy.view.headline"/></h1>
	<div id="kurancies">
		<table>
			<thead>
				<tr>
					<th>Amount</th>
					<th>Token</th>
					<th>Created On</th>
					<th>Status</th>
					<th>Claimed By</th>
					<th>Claimed On</th>
					<th colspan="3">Actions</th>
				</tr>
			<c:forEach items="${kurancyCreateds}" var="kurancy">
				<tr>
					<td>$<c:out value="${kurancy.amount}"/></td>
					<td><c:out value="${ fn:substring(kurancy.kurancyToken, 0, 4)}"/>-<c:out value="${ fn:substring(kurancy.kurancyToken, 4, 8)}"/></td>
					<td><fmt:formatDate value="${kurancy.createdOn}" dateStyle="long"/></td>
					<td><c:out value="${kurancy.status}"/></td>
					<td><c:out value="${kurancy.claimedBy}"/></td>
					<td><fmt:formatDate value="${kurancy.claimedOn}" dateStyle="long"/></td>
					<td><span class="ui-icon ui-icon-mail-closed"></span>Email</td>
					<td><span class="ui-icon ui-icon-print"></span>Print</td>
					<td><span class="ui-icon ui-icon-cart"></span><a href="/myKurancy/pay?identifier=${kurancy.kurancyToken}&paypalVersion=1">Payment Due</a></td>
				</tr>
			</c:forEach>
		</table>
	</div>
</div>